<?php


namespace app\api\model;

use think\Model;

class User extends Model
{
    protected $name = 'user';
    protected $type = [ 'create_time' => 'timestamp:Y-m-d H:i', ];
    // 开启自动写入时间戳 
    protected $autoWriteTimestamp = true; 
    // 定义一对多关联
    public function dongtais()
    {
        return $this->hasMany('DongTai');
    }
    
    public function dianzans()
    {
        return $this->hasMany('Dianzan');
    }
    public function pinluns()
    {
        return $this->hasMany('Pinlun');
    }
    public function addresss()
    {
        return $this->hasMany('Address');
    }
    public function orders()
    {
        return $this->hasMany('Order');
    }
   public function guanzhus()
   {
   		return $this->hasMany('GuanZhu');
   }
   public function topics()
   {
   	return $this->hasMany('Topic');
   }
}